/*
 * socket.cc
 *
 *  Created on: Dec 16, 2014
 *      Author: root
 */
#include <stdio.h>
#include <arpa/inet.h>
#include "socket.h"

char* Socket::ToString() const {
	static char info[128] = { 0 };
	sprintf(info, "%s:%d", inet_ntoa(*((struct in_addr*) &addr)),
			ntohs(this->port));
//		printf("%s\n", info);
	return info;
}
bool Socket::operator ==(const Socket& c) {
	return this->addr == c.addr && this->port == c.addr;
}
